class AddCategoryIdIntoHouses < ActiveRecord::Migration
  def self.up
    add_column :houses, :category_id, :integer

    add_index :houses, :category_id
    add_index :houses, [:house_type_id, :category_id]
  end

  def self.down
    remove_index :houses, :column => [:house_type_id, :category_id]
    remove_index :houses, :column => :category_id

    remove_column :houses, :category_id
  end
end
